<?php
	include '../ini.php';
	include '../../libraries/xl_loai_san_pham.php';
	include '../../libraries/my_pager.php';
	$dt_xl_loai_san_pham=new xl_loai_san_pham;
	$dt_phan_trang=new my_pager;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include'../widgets/js_css.php'?>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include '../widgets/sidebar.php'?>
  <div id="main-content"> <!-- Main Content Section with everything -->
    
  <!--noscript-->
    
    <!-- Page Head --> 
    <!-- End .shortcut-buttons-set -->
    
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Danh sách loại sản phẩm</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
          <?php thong_bao()?>
          <form action="xoa_nhieu.php" method="post" name="f_loai_sp">
          <table>
            <thead>
              <tr>
                <th><input title="Chọn tất cả" class="check-all" type="checkbox"/></th>
                <th>Mã</th>
                <th>Tên loại bài viết</th>
                <th>Thứ tự hiển thị</th>
                <th>Thuộc về</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="3"><div class="bulk-actions align-left"> <a class="button" href="them.php">Thêm</a> <a onclick="if(confirm('Bạn có muốn xóa liên hệ đã chọn không?')==true) document.f_loai_sp.submit()" class="button" >Xóa</a> </div>
                  <div align="center" class="pagination">
                    <?php
						$tong_so_sp=$dt_xl_loai_san_pham->so_luong();
						$tong_so_trang=$dt_phan_trang->tong_so_trang($tong_so_sp,ADMIN_LIMIT);
						if($tong_so_sp > ADMIN_LIMIT)
							echo $dt_phan_trang->xuat_phan_trang_admin($_GET['page'],$tong_so_trang);
                    ?>
                  </div>
                  
                  <!-- End .pagination -->
                  
                  <div class="clear"></div></td>
              </tr>
            </tfoot>
            <tbody>
              <?php
				$vi_tri=$dt_phan_trang->vi_tri(ADMIN_LIMIT);
				$ds_loai_san_pham=$dt_xl_loai_san_pham->danh_sach($vi_tri,ADMIN_LIMIT);
				foreach($ds_loai_san_pham as $loai_san_pham)
				{
			  ?>
              <tr>
                <td><input title="Chọn" type="checkbox" value="<?php echo $loai_san_pham['ma']?>" name="item[]"/>
                  
                  <!-- Icons --> 
                  <a href="cap_nhat.php?ma=<?php echo $loai_san_pham['ma']?>" title="Sửa"><img src="../skins/sa/resources/images/icons/pencil.png" alt="Edit" /></a> <a onclick="return confirm('Bạn có muốn xóa loại sản phẩm này không?');" href="xoa_sm.php?ma=<?php echo $loai_san_pham['ma']?>" title="Xóa"><img src="../skins/sa/resources/images/icons/cross.png" alt="Delete" /></a></td>
                <td><?php echo $loai_san_pham['ma']?></td>
                <td><?php echo $loai_san_pham['ten']?></td>
                <td><?php echo $loai_san_pham['thu_tu_hien_thi']?></td>
                <td><?php echo $loai_san_pham['ten_loai_cha']?></td>
              </tr>
              <?php }?>
            </tbody>
          </table>
          </form>
        </div>
        <!-- End #tab1 --> 
        
      </div>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <div class="clear"></div>
    <div id="footer"> <small> <!-- Remove this notice or replace it with whatever you want --> 
    <!-- End #footer --> 
    
  </div>
  <!-- End #main-content --> 
</div>
</body>
</html>
